<?php
/* @var $this DiretorioController */
/* @var $model Diretorio */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'diretorio-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
   
       <?php
           //$path = Diretorio::getPath('18', '*');
           //print_r($path); 
            
       ?>
        <br />
           
       <?php
           // echo CHtml::dropDownList('diretorio', null, Diretorio::getPathOptions(), array('empty' => '(Select a name)'));
           // echo CHtml::dropDownList('diretorio', null, Diretorio::getChildren('', '0'), array('empty' => '(Select a name)'));
 
       ?>
        

	<div class="row">
		<?php echo $form->labelEx($model,'parent_id'); ?>
                <?php echo $form->dropDownList($model,'parent_id', Diretorio::getPathOptions()); ?>
		<?php  //echo CHtml::dropDownList('parent_id', null, Diretorio::getPathOptions(), array('empty' => '(Selecione um Diretório)')); ?>
		<?php echo $form->error($model,'parent_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'diretorio'); ?>
		<?php echo $form->textField($model,'diretorio',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'diretorio'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'assunto'); ?>
		<?php echo $form->textField($model,'assunto',array('size'=>60,'maxlength'=>60)); ?>
		<?php echo $form->error($model,'assunto'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'id_area'); ?>
		<?php echo $form->textField($model,'id_area'); ?>
		<?php echo $form->error($model,'id_area'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'id_gestor'); ?>
		<?php echo $form->textField($model,'id_gestor'); ?>
		<?php echo $form->error($model,'id_gestor'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'descricao'); ?>
		<?php echo $form->textArea($model,'descricao',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'descricao'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'gr_global'); ?>
		<?php echo $form->textField($model,'gr_global'); ?>
		<?php echo $form->error($model,'gr_global'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'gr_leitura'); ?>
		<?php echo $form->textField($model,'gr_leitura'); ?>
		<?php echo $form->error($model,'gr_leitura'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'gr_gravacao'); ?>
		<?php echo $form->textField($model,'gr_gravacao'); ?>
		<?php echo $form->error($model,'gr_gravacao'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->